﻿using Dyao.Book.Contract;

namespace Dyao.Book.Application
{
    public static class TaskCenterRightsFilter
    {
        private readonly static Dictionary<string, Func<TaskCenterRightsFilterModel, bool>> _rightsFilterDic;

        static TaskCenterRightsFilter()
        {
            _rightsFilterDic = new Dictionary<string, Func<TaskCenterRightsFilterModel, bool>>()
            {
                {
                    TaskCenterCodes.TestTaskCenterDistributedUpdate,
                    (filter) => filter.UserId == 333
                },
            };
        }
        public static bool IsIgnore(string actioName, TaskCenterRightsFilterModel filterModel)
        {

            return _rightsFilterDic.TryGetValue(actioName, out var filter) && filter(filterModel);
        }
    }

    public class TaskCenterRightsFilterModel
    {
        public int UserId { get; set; }
    }

}
